package com.lcf.mulit.error;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@ControllerAdvice
public class ErrorHandler {

    @ResponseBody
    @ExceptionHandler(RuntimeException.class)
    public Map<String, Object> resultMap() {
        Map<String, Object> resultMap = new HashMap<>();

        resultMap.put("errCode", 500);
        resultMap.put("errCode", "全局异常捕获");
        return resultMap;

    }
}
